package com.ssy.lingxi.order.service.web;

import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.order.entity.DeliveryOrderDO;
import com.ssy.lingxi.order.entity.DeliveryOrderProductDO;
import com.ssy.lingxi.order.model.vo.basic.request.*;
import com.ssy.lingxi.order.model.vo.basic.response.DeliveryOrderDetailVO;
import com.ssy.lingxi.order.model.vo.basic.response.DeliveryOrderProductQueryVO;
import com.ssy.lingxi.order.model.vo.basic.response.DeliveryOrderQueryVO;
import org.springframework.http.HttpHeaders;

import java.util.List;

/**
 *  送货单相关接口
 * @author ds
 * @date 2022/3/24
 * @version 2.0.0
 */
public interface IDeliveryOrderService {
    /**
     * 分页查询送货单-SRM
     * @param headers HttpHeaders信息
     * @param deliveryDateVO 接口参数
     * @return 查询结果
     */
    Wrapper<PageData<DeliveryOrderQueryVO>> pageBySRM(HttpHeaders headers, DeliveryOrderPageVO deliveryDateVO);
    /**
     * 分页查询送货单-B2B
     * @param headers HttpHeaders信息
     * @param deliveryDateVO 接口参数
     * @return 查询结果
     */
    Wrapper<PageData<DeliveryOrderQueryVO>> pageByB2B(HttpHeaders headers, DeliveryOrderPageVO deliveryDateVO);

    /**
     * 分页查询送货单-物料信息
     * @param headers
     * @param pageVO
     * @return
     */
    Wrapper<PageData<DeliveryOrderProductQueryVO>> pageProducts(HttpHeaders headers, DeliveryOrderProductPageVO pageVO);

    /**
     * 创建送货单
     * @param headers
     * @param param
     * @param type  DeliveryOrderTypeStatusEnum
     * @return
     */
    Wrapper<Void> createDeliveryOrder(HttpHeaders headers, DeliveryOrderCreateVO param, Integer type);

    /**
     * 送货单详情
     * @param headers
     * @param request
     * @return
     */
    Wrapper<DeliveryOrderDetailVO> detail(HttpHeaders headers, IdVO request);

    /**
     * 修改进货单
     * @param headers
     * @param request
     * @return
     */
    Wrapper<Void> update(HttpHeaders headers, DeliveryOrderUpdateVO request);

    /**
     * 作废
     * @param headers
     * @param request
     * @return
     */
    Wrapper<Void> invalid(HttpHeaders headers, InvalidVO request);

    /**
     *  根据送货单id与送货单明细id查询明细记录[内部查询用]
     * @param deliveryOrderId
     * @param orderProductIdList
     * @return
     */
    List<DeliveryOrderProductDO> getProductList(Long deliveryOrderId, List<Long> orderProductIdList);


    /**
     * 查询送货单DO[内部查询用]
     * @param id
     * @return
     */
    DeliveryOrderDO getDeliveryOrderDO(Long id);

    /**
     * 分页查询送货单-(采购会员查询)
     * @param headers HttpHeaders信息
     * @param deliveryDateVO 接口参数
     * @return 查询结果
     */
    Wrapper<PageData<DeliveryOrderQueryVO>> pageByBuyer(HttpHeaders headers, DeliveryOrderPageVO deliveryDateVO);

    /**
     * 更新送货单状态[内部使用]
     * @param loginUser
     * @param deliveryOrderId
     * @param status DeliveryOrderOuterStatusEnum
     */
    void updateStatus(UserLoginCacheDTO loginUser,Long deliveryOrderId,Integer status);
}
